<template>
	<view>
		<u-navbar title="新人活动" titleColor="#FFFFFF" backIconColor="#FFFFFF" :borderBottom="false"
			:background="background"> </u-navbar>
		<view class="top"></view>
		<view class="content">
			<view class="list" v-if="item.hide!=1" @click="toABC(item)" v-for="(item,index) in data" :key="index">
				<view class="up">
					<image :src="'../static/'+item.image+'.png'" mode=""></image>
					<view class="left">
						<view class="name">
							{{item.name}}
						</view>
						<view class="text">
							{{item.text}}
						</view>
					</view>
				</view>
				<view class="down">
					<view class="d1">
						<view style="display: flex;align-items: center;">
							<image src="../static/b0.png" mode=""></image>
							<view class="text">
								{{item.person}}人已参与
							</view>
						</view>
					</view>
					<view class="d2">
						<image v-for="(a,b) in item.list" :key="b" :src="getHead(a.picture)" mode=""></image>
					</view>
				</view>
				<image src="../static/go.png" class="go"></image>
			</view>
		</view>
		<u-popup v-model="show" close-icon-pos="top-left" :closeable="true" borderRadius="10" mode="bottom">
			<view class="harvest">
				<view class="_view">
					<view class="title">
						温馨提示
					</view>
					<view class="text">
						当前为新人专属活动，老玩家请访问 活动专区 <text>享更多超值大礼</text>
					</view>
				</view>
				<button type="default" class="button2" @click="toPage('/pages/htmlH/index/index')">立即前往</button>
				<view class="popup_top"></view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				background: {
					background: 'transparent'
				},
				data: [{
					image: 'b1',
					name: '蜂盈见面礼',
					text: '完成新手任务，领取见面礼',
					url: '/pages/htmlH/blind/index'
				}, {
					image: 'b2',
					name: '蜜贝迎新礼',
					text: '首次充值蜜贝，优惠多多',
					url: '../conversion/index'
				}, {
					image: 'b3',
					name: '特权抢拍区',
					text: '蜂巢尽在专区，快去抢拍吧',
					url: '../land/index'
				}],
				show: false
			}
		},
		onLoad(option) {
			than = this;
			than.post('api/novice_goods/activeList', null, function(data) {
				than.data[0].hide = parseInt(data.meet_hide)
				than.data[1].hide = parseInt(data.kmb_hide)
				than.data[2].hide = parseInt(data.goods_hide)
				than.data[0].active = parseInt(data.meet_active_status)
				than.data[1].active = parseInt(data.kmb_active_status)
				than.data[2].active = parseInt(data.goods_active_status)
				than.data[0].user = parseInt(data.meet_user_status)
				than.data[1].user = parseInt(data.kmb_user_status)
				than.data[2].user = parseInt(data.goods_user_status)
				than.data[0].person = parseInt(data.meet_real_person)
				than.data[1].person = parseInt(data.kmb_real_person)
				than.data[2].person = parseInt(data.goods_real_person)
				than.data[0].list = data.meet_picture_list
				than.data[1].list = data.kmb_picture_list
				than.data[2].list = data.goods_picture_list
				than.$forceUpdate();
			})
		},
		methods: {
			toABC(json) {
				if (json.active == 1) {
					if (json.user == 1) {
						than.toPage(json.url)
					} else {
						than.show=true;
					}
				} else {
					than.toast("活动暂未开放")
				}
			}
		}
	}
</script>

<style lang="less">
	.top {
		background-image: url(../static/a1.png);
		background-size: 100% 100%;
		width: 100%;
		height: 354rpx;
		position: absolute;
		top: 0;
	}

	page {
		background: #F6F6F6;
	}

	.harvest {
		text-align: center;


		.popup_top {
			height: 30rpx;
		}

		.img {
			overflow: hidden;
			padding: 0 55rpx;
			margin-top: 44rpx;

			.left {
				float: left;

				image {
					width: 27rpx;
					height: 27rpx;
				}
			}

			.right {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;

				text {
					color: #004FFF;
				}
			}

		}

		._view {
			background: #FFFFFF;
			margin: 0 30rpx;
			padding-bottom: 1rpx;


			.title {
				height: 111rpx;
				line-height: 111rpx;
				text-align: center;
				border-bottom: 2rpx solid #F6F6F6;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.text {
				padding: 80rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;

				text {
					color: #FB683D;
				}
			}
		}


		.button2 {
			margin: 20rpx auto 0;
			color: #FFFFFF;
			width: 245rpx;
			height: 74rpx;
			background: #FB683D;
			border-radius: 20rpx;
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 74rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
		}

	}

	.content {
		margin-top: 300rpx;

		.list {
			margin: 0 36rpx 24rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			position: relative;

			.go {
				right: 24rpx;
				bottom: 24rpx;
				position: absolute;
				width: 45rpx;
				height: 45rpx;
			}

			.up {
				display: flex;
				align-items: center;
				height: 176rpx;

				image {
					width: 98rpx;
					height: 98rpx;
					margin: 0 23rpx;
				}

				.left {
					.name {
						font-size: 36rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
					}

					.text {
						margin-top: 10rpx;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #999999;
					}
				}
			}

			.down {
				height: 156rpx;
				padding-left: 144rpx;

				.d1 {
					height: 36rpx;
					background: #F5F8FD;
					border-radius: 4rpx;
					padding: 0 17rpx;
					display: inline-block;

					image {
						width: 17rpx;
						height: 20rpx;
					}

					.text {
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #467FF5;
					}
				}

				.d2 {
					margin-top: 18rpx;

					image {
						margin-right: 6rpx;
						width: 37rpx;
						height: 37rpx;
						border-radius: 50%;
					}
				}
			}
		}
	}
</style>
